package App.Repository;

import App.Entity.ProjectCheck;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * Created by yu on 2017/7/20.
 */
public interface ProjectCheckRepository extends CrudRepository<ProjectCheck,Long>
{
    @Query("select projectId from ProjectCheck check where check.authId=:authId")
    public List<Long> getProjectIdsByAuthId(@Param("authId")Long authId);

    @Query("select authId from ProjectCheck check where check.projectId=:projectId")
    public List<Long> getPeopleIdsByProjectId(@Param("projectId") Long projectId);

    @Query("select id from ProjectCheck check where check.authId=:authId and check.projectId=:projectId")
    public Long getIdByAuthIdAndProjectId(@Param("authId") Long AuthId,@Param("projectId")Long ProjectId);


}
